package xhwl.hmo.mall.http.api;


import com.google.gson.Gson;

import okhttp3.RequestBody;
import rx.Observable;
import xhwl.hmo.mall.http.ApiService;
import xhwl.retrofitrx.BaseApi;

/**
 * Created by admin on 2017/1/16.
 */

public class FindApi extends BaseApi {
    AddressInfoReq req;
    public FindApi(String type_name,String member_mobile,int page_num){
        req=new AddressInfoReq(type_name,member_mobile,page_num);
        setShowDialog(true);
    }

    @Override
    protected Observable getObservable() {
        RequestBody requestBody = RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"), new Gson().toJson(req));
        return retrofit.create(ApiService.class).find(requestBody);
    }
    public class AddressInfoReq {
        private String type_name;
        private String member_mobile;
        private int page_num;

        public AddressInfoReq(String type_name,String member_mobile,int page_num) {
            this.type_name=type_name;
            this.member_mobile=member_mobile;
            this.page_num=page_num;
        }
    }
}
